<template>
  <el-card class="box-card" style="margin-top: 10px">
    <TopicItem :tableData="tableData" />
    <Pagination
      v-show="parseInt(pageObj.count) > 0"
      :total="parseInt(pageObj.count)"
      @change="getList"
      :page.sync="listQuery.page"
      :limit.sync="listQuery.limit"
    />
  </el-card>
</template>
<script>
export default {
  components: {
    TopicItem: () => import('../main/TopicItem.vue'),
  },
  data() {
    return {
      listQuery: {
        page: 1,
        limit: 10,
        status: '1',
        auditStatus: '2',
        createBy: '',
      },
      tableData: [],
      pageObj: {},
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    async getList() {
      this.listQuery.createBy = this.$route.query.id
      let res = await this.$store.dispatch('queryBbsTopic', this.listQuery)
      this.tableData = res.data
      this.pageObj = res
    },
  },
}
</script>
<style scoped lang="scss">
</style>